package kr.hkit.powerjava.chapter22.collection;

import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

public class LinkedListTest {
	public static void main(String[] args) {
		List<String> arList = new LinkedList<>();
		arList.add("MILK");
		arList.add("BREAD");
		arList.add("BUTTER");
		
		arList.add(1, "APPLE");
		arList.set(2, "GRAPE");
		String temp = arList.remove(0);
		System.out.println("제거된 문자열은 "+ temp);
		
		Collections.sort(arList);
		for(String str : arList) {
			System.out.println(str);
		}
	}
}